'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller,jwt  } = app;
  router.get('/', controller.home.index);
  router.get('/judge', controller.home.index);
  router.get('/mysql', controller.home.mysql);

  // 用户
  router.post('/user/login', controller.user.login);
  router.post('/user/register', controller.user.register);
  router.post('/user/update',jwt, controller.user.update);
  router.post('/user/logout',jwt, controller.user.logout);
  router.get('/user/getcode', controller.user.getcode);
  router.post('/user/update', controller.test.upload);
  
  // 商城
  // 签到
  router.post('/sign/list',jwt, controller.sign.list);
  router.post('/sign/sign',jwt, controller.sign.sign);
  // 浏览历史
  router.post('/history/list',jwt, controller.userHistory.list);
  router.post('/history/history',jwt, controller.userHistory.history);
  // Test
  router.get('/judge', controller.home.index);
  router.get('/test/list', controller.test.list);
  router.get('/test/item', controller.test.item);
  router.post('/test/upload', controller.test.upload);
};
